package cn.jinjie.day03.test15;

public class Cylinder implements C {
    private Double radius;//底圆半径
    private Double height;//圆柱体的高
    private String color;

    public Cylinder() {
    }

    public Cylinder(Double radius, Double height) {
        this.radius = radius;
        this.height = height;
    }

    public Cylinder(Double radius, Double height, String color) {
        this.radius = radius;
        this.height = height;
        this.color = color;
    }


    @Override
    public double area() {
        return 2 * PI * radius * radius + 2 * PI * radius * height;
    }

    @Override
    public void setColor(String c) {
        System.out.println(c + "的圆柱体");
    }

    @Override
    public double volume() {
        return PI * radius * radius * height;
    }
}
